home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-05-11 | 94.4 KB | 1,690 lines |
- card_12597.xml
- <?xml version="1.0" encoding="utf-8" ?>
- <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
- <card>
- <id>12597</id>
- <filler1>0</filler1>
- <cantDelete> <false /> </cantDelete>
- <showPict> <true /> </showPict>
- <dontSearch> <false /> </dontSearch>
- <owner>8636</owner>
- <link rel="stylesheet" type="text/css" href="stylesheet_3084.css" />
- <part>
- <id>1</id>
- <type>field</type>
- <visible> <true /> </visible>
- <dontWrap> <false /> </dontWrap>
- <dontSearch> <false /> </dontSearch>
- <sharedText> <false /> </sharedText>
- <fixedLineHeight> <false /> </fixedLineHeight>
- <autoTab> <false /> </autoTab>
- <lockText> <true /> </lockText>
- <rect>
- <left>405</left>
- <top>24</top>
- <right>432</right>
- <bottom>41</bottom>
- </rect>
- <style>opaque</style>
- <autoSelect> <false /> </autoSelect>
- <showLines> <false /> </showLines>
- <wideMargins> <false /> </wideMargins>
- <multipleLines> <false /> </multipleLines>
- <reservedFamily> 0 </reservedFamily>
- <titleWidth>0</titleWidth>
- <icon>0</icon>
- <textAlign>center</textAlign>
- <font>Chicago</font>
- <textSize>12</textSize>
- <textStyle>plain</textStyle>
- <textHeight>16</textHeight>
- <name></name>
- <script></script>
- </part>
- <content>
- <layer>card</layer>
- <id>1</id>
- <text>OS</text>
- </content>
- <content>
- <layer>background</layer>
- <id>9</id>
- <text><span class="style1">oolean flag;
-
- switch (event.what)
- {
-
- case osEvt:
- {
- flag = (event.message & resumeFlag) != 0;
- </span><span class="style14"><a href="#" class="group">TMResume</a></span><span class="style1">(terminal, flag);
- }
- break;
-
- }
- </span></text>
- </content>
- <name>OS</name>
- <script></script>
- </card>
-
-
- card_12422.xml
- <?xml version="1.0" encoding="utf-8" ?>
- <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
- <card>
- <id>12422</id>
- <filler1>0</filler1>
- <cantDelete> <false /> </cantDelete>
- <showPict> <true /> </showPict>
- <dontSearch> <false /> </dontSearch>
- <owner>8636</owner>
- <link rel="stylesheet" type="text/css" href="stylesheet_3084.css" />
- <part>
- <id>1</id>
- <type>field</type>
- <visible> <true /> </visible>
- <dontWrap> <false /> </dontWrap>
- <dontSearch> <false /> </dontSearch>
- <sharedText> <false /> </sharedText>
- <fixedLineHeight> <false /> </fixedLineHeight>
- <autoTab> <false /> </autoTab>
- <lockText> <true /> </lockText>
- <rect>
- <left>394</left>
- <top>24</top>
- <right>447</right>
- <bottom>41</bottom>
- </rect>
- <style>opaque</style>
- <autoSelect> <false /> </autoSelect>
- <showLines> <false /> </showLines>
- <wideMargins> <false /> </wideMargins>
- <multipleLines> <false /> </multipleLines>
- <reservedFamily> 0 </reservedFamily>
- <titleWidth>0</titleWidth>
- <icon>0</icon>
- <textAlign>center</textAlign>
- <font>Chicago</font>
- <textSize>12</textSize>
- <textStyle>plain</textStyle>
- <textHeight>16</textHeight>
- <name></name>
- <script></script>
- </part>
- <content>
- <layer>card</layer>
- <id>1</id>
- <text>Menus</text>
- </content>
- <content>
- <layer>background</layer>
- <id>9</id>
- <text>menuItem = MenuSelect(event.where);
- menu = HiWord(menuItem);
- item = LoWord(menuItem);
- switch (menu)
- {
- case AppleMenu :
- {
- switch (item)
- {
- …
- }
- }
- break;
-
- case FileMenu :
- {
- switch (item)
- {
- …
- }
- }
- break;
-
- …
- …
- …
-
- default :
- {
- if (! TMMenu(terminal, menu, item))
- {
- …
- }
- }
- break;
- }
- </text>
- </content>
- <name>Menus</name>
- <script></script>
- </card>
-
-
- card_8189.xml
- <?xml version="1.0" encoding="utf-8" ?>
- <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
- <card>
- <id>8189</id>
- <filler1>0</filler1>
- <cantDelete> <false /> </cantDelete>
- <showPict> <true /> </showPict>
- <dontSearch> <false /> </dontSearch>
- <owner>8636</owner>
- <link rel="stylesheet" type="text/css" href="stylesheet_3084.css" />
- <part>
- <id>1</id>
- <type>field</type>
- <visible> <true /> </visible>
- <dontWrap> <false /> </dontWrap>
- <dontSearch> <false /> </dontSearch>
- <sharedText> <false /> </sharedText>
- <fixedLineHeight> <false /> </fixedLineHeight>
- <autoTab> <false /> </autoTab>
- <lockText> <true /> </lockText>
- <rect>
- <left>380</left>
- <top>24</top>
- <right>458</right>
- <bottom>41</bottom>
- </rect>
- <style>opaque</style>
- <autoSelect> <false /> </autoSelect>
- <showLines> <false /> </showLines>
- <wideMargins> <false /> </wideMargins>
- <multipleLines> <false /> </multipleLines>
- <reservedFamily> 0 </reservedFamily>
- <titleWidth>0</titleWidth>
- <icon>0</icon>
- <textAlign>center</textAlign>
- <font>Chicago</font>
- <textSize>12</textSize>
- <textStyle>plain</textStyle>
- <textHeight>16</textHeight>
- <name></name>
- <script></script>
- </part>
- <content>
- <layer>card</layer>
- <id>1</id>
- <text>Key Press</text>
- </content>
- <content>
- <layer>background</layer>
- <id>9</id>
- <text>switch (event.what)
- {
- case keyDown:
- {
- window = FrontWindow();
- if (window == gWindow)
- {
- TMKey(gTerminal, &event);
- }
- else
- if (terminal == (*window).refCon)
- {
- TMEvent(terminal, &event);
- }
- }
- break;
- }
-
-
-
- </text>
- </content>
- <name>Key</name>
- <script></script>
- </card>
-
-
- card_12069.xml
- <?xml version="1.0" encoding="utf-8" ?>
- <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
- <card>
- <id>12069</id>
- <filler1>0</filler1>
- <cantDelete> <false /> </cantDelete>
- <showPict> <true /> </showPict>
- <dontSearch> <false /> </dontSearch>
- <owner>8636</owner>
- <link rel="stylesheet" type="text/css" href="stylesheet_3084.css" />
- <part>
- <id>1</id>
- <type>field</type>
- <visible> <true /> </visible>
- <dontWrap> <false /> </dontWrap>
- <dontSearch> <false /> </dontSearch>
- <sharedText> <false /> </sharedText>
- <fixedLineHeight> <false /> </fixedLineHeight>
- <autoTab> <false /> </autoTab>
- <lockText> <true /> </lockText>
- <rect>
- <left>388</left>
- <top>24</top>
- <right>452</right>
- <bottom>41</bottom>
- </rect>
- <style>opaque</style>
- <autoSelect> <false /> </autoSelect>
- <showLines> <false /> </showLines>
- <wideMargins> <false /> </wideMargins>
- <multipleLines> <false /> </multipleLines>
- <reservedFamily> 0 </reservedFamily>
- <titleWidth>0</titleWidth>
- <icon>0</icon>
- <textAlign>center</textAlign>
- <font>Chicago</font>
- <textSize>12</textSize>
- <textStyle>plain</textStyle>
- <textHeight>16</textHeight>
- <name></name>
- <script></script>
- </part>
- <content>
- <layer>card</layer>
- <id>1</id>
- <text>Window</text>
- </content>
- <content>
- <layer>background</layer>
- <id>9</id>
- <text>switch (event.what)
- {
- case mouseDown:
- {
- switch (FindWindow(event.where, &window))
- {
- case inGoAway :
- case inGrow :
- case inZoomIn :
- case inZoomOut :
- case inContent :
- {
- if (window == gTerminalWindow)
- {
- TMClick(terminal, &event);
- }
- else
- if (terminal == (*window).refCon)
- {
- TMEvent(terminal, &event);
- }
- }
- break;
- }
- }
- break;
-
- case updateEvt:
- {
- window = (WindowPeek) event.message;
- if (window == gTerminalWindow)
- {
- SetPort(window);
- BeginUpdate(window);
- TMUpdate(terminal,
- (*(WindowPeek)window).port.visRgn);
- DrawGrowIcon(window);
- DrawControls(window);
- EndUpdate(window);
- }
- else
- if (terminal == (*window).refCon)
- {
- TMEvent(terminal, &event);
- }
- }
- break;
-
- case activateEvt:
- {
- window = (WindowPeek) event.message;
- if (window == gTerminalWindow)
- {
- TMActivate(terminal,
- event.modifiers & activeFlag);
- }
- else
- if (terminal == (*window).refCon)
- {
- TMEvent(terminal, &event);
- }
- }
- break;
-
- }
-
- </text>
- </content>
- <name>Window</name>
- <script></script>
- </card>
-
-
- card_8903.xml
- <?xml version="1.0" encoding="utf-8" ?>
- <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
- <card>
- <id>8903</id>
- <filler1>0</filler1>
- <cantDelete> <false /> </cantDelete>
- <showPict> <true /> </showPict>
- <dontSearch> <false /> </dontSearch>
- <owner>8636</owner>
- <link rel="stylesheet" type="text/css" href="stylesheet_3084.css" />
- <part>
- <id>1</id>
- <type>field</type>
- <visible> <false /> </visible>
- <dontWrap> <false /> </dontWrap>
- <dontSearch> <false /> </dontSearch>
- <sharedText> <false /> </sharedText>
- <fixedLineHeight> <false /> </fixedLineHeight>
- <autoTab> <false /> </autoTab>
- <lockText> <false /> </lockText>
- <rect>
- <left>130</left>
- <top>280</top>
- <right>576</right>
- <bottom>352</bottom>
- </rect>
- <style>scrolling</style>
- <autoSelect> <false /> </autoSelect>
- <showLines> <false /> </showLines>
- <wideMargins> <false /> </wideMargins>
- <multipleLines> <false /> </multipleLines>
- <reservedFamily> 0 </reservedFamily>
- <titleWidth>0</titleWidth>
- <icon>0</icon>
- <textAlign>left</textAlign>
- <font>Geneva</font>
- <textSize>9</textSize>
- <textStyle>plain</textStyle>
- <textHeight>12</textHeight>
- <name>the 411 info</name>
- <script></script>
- </part>
- <part>
- <id>3</id>
- <type>field</type>
- <visible> <true /> </visible>
- <dontWrap> <false /> </dontWrap>
- <dontSearch> <false /> </dontSearch>
- <sharedText> <false /> </sharedText>
- <fixedLineHeight> <false /> </fixedLineHeight>
- <autoTab> <false /> </autoTab>
- <lockText> <true /> </lockText>
- <rect>
- <left>366</left>
- <top>24</top>
- <right>473</right>
- <bottom>41</bottom>
- </rect>
- <style>opaque</style>
- <autoSelect> <false /> </autoSelect>
- <showLines> <false /> </showLines>
- <wideMargins> <false /> </wideMargins>
- <multipleLines> <false /> </multipleLines>
- <reservedFamily> 0 </reservedFamily>
- <titleWidth>0</titleWidth>
- <icon>0</icon>
- <textAlign>center</textAlign>
- <font>Chicago</font>
- <textSize>12</textSize>
- <textStyle>plain</textStyle>
- <textHeight>16</textHeight>
- <name></name>
- <script></script>
- </part>
- <content>
- <layer>card</layer>
- <id>3</id>
- <text>Event Handling</text>
- </content>
- <content>
- <layer>card</layer>
- <id>1</id>
- <text>√¶KY TMClick
- Mouse events
-
- Procedure TMClick(hTerm: TermHandle; theEvent: EventRecord);
-
- Description: TMClick processes a mouseDown vent in the terminal
- emulation region. The routine pointed to by myclikLoop,
- discussed later in this chapter in the section “Routines
- That Must Be in Your Application,” is called repeatedly
- by TMClick.
- •
- √¶KY TMEvent
- Other events
-
- Procedure TMEvent(hTerm: TermHandle; theEvent: EventRecord);
-
- Description: When your application receives an event, it should check
- whether the refcon of the window is a tool’s hTerm. Such
- an event occurs, for example, when the user clicks a
- button in a dialog box displayed by the terminal tool.
- If it does belong to a terminal tool’s window, your
- application can call TMEvent.
-
- A window (or dialog box) created by a terminal tool has
- a terminal record handle stored in the refCon field for
- windowRecord.
- •
- √¶KY TMUpdate
- Update events
-
- Procedure TMUpdate(hTerm: TermHandle; visRgn: RgnHandle);
-
- Description: Your application will typically call TMUpdate between
- BeginUpdate and EndUpdate.
-
- visRgn specifies the region to be updated.
- •
- √¶KY TMActivate
- Activate events
-
- Procedure TMActivate(hTerm: TermHandle; activate: BOOLEAN);
-
- Description: TMActivate processes an activate or deactivate event
- (for instance, installing or removing a custom tool
- menu) for a window associated with the terminal tool.
-
- If activate is TRUE, the terminal tool processes an
- activate event. Otherwise, it processes a deactivate
- event.
- •
- √¶KY TMKey
- Keyboard events
-
- Procedure TMKey(hTerm: TermHandle; theEvent: EventRecord);
-
- Description: TMKey processes a keyDown or autoKey event. The terminal
- tool translates the keystroke into a sequence of bytes.
- The terminal tool then calls your application’s sendProc
- routine (discussed later in this chapter under “Routines
- That Must Be in Your Application.”) to transmit this
- sequence of bytes.
-
- Your application can create its own event record for
- specific keyboard events by filling in the event record
- with the character code and –1 for the key code in the
- message field.
- •
- √¶KY TMResume
- Resume events
-
- Procedure TMResume(hTerm: TermHandle; resume: BOOLEAN);
-
- Description: TMResume processes a resume or suspend event for a
- terminal window. Resume and suspend events are processed
- only if a tool has a custom menu to install or remove
- from the menu bar.
-
- If resume is TRUE, then the terminal processes a resume
- event. Otherwise, it processes a suspend event.
- •
- √¶KY TMMenu
- Menu events
-
- Function TMMenu(hTerm: TermHandle; menuID: INTEGER; item:
- INTEGER): BOOLEAN;
-
- Description: Your application must call TMMenu when the user chooses
- an item from a menu that is installed by the terminal
- tool.
-
- TMMenu returns FALSE if the terminal tool did not handle
- the menu event. TMMenu returns TRUE if the terminal tool
- did handle the menu event.
- •
- </text>
- </content>
- <name>event</name>
- <script></script>
- </card>
-
-
- card_12925.xml
- <?xml version="1.0" encoding="utf-8" ?>
- <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
- <card>
- <id>12925</id>
- <filler1>0</filler1>
- <cantDelete> <false /> </cantDelete>
- <showPict> <true /> </showPict>
- <dontSearch> <false /> </dontSearch>
- <owner>7555</owner>
- <link rel="stylesheet" type="text/css" href="stylesheet_3084.css" />
- <part>
- <id>1</id>
- <type>field</type>
- <visible> <true /> </visible>
- <dontWrap> <false /> </dontWrap>
- <dontSearch> <false /> </dontSearch>
- <sharedText> <false /> </sharedText>
- <fixedLineHeight> <false /> </fixedLineHeight>
- <autoTab> <false /> </autoTab>
- <lockText> <true /> </lockText>
- <rect>
- <left>390</left>
- <top>24</top>
- <right>444</right>
- <bottom>41</bottom>
- </rect>
- <style>opaque</style>
- <autoSelect> <false /> </autoSelect>
- <showLines> <false /> </showLines>
- <wideMargins> <false /> </wideMargins>
- <multipleLines> <false /> </multipleLines>
- <reservedFamily> 0 </reservedFamily>
- <titleWidth>0</titleWidth>
- <icon>0</icon>
- <textAlign>center</textAlign>
- <font>Chicago</font>
- <textSize>12</textSize>
- <textStyle>plain</textStyle>
- <textHeight>16</textHeight>
- <name></name>
- <script></script>
- </part>
- <content>
- <layer>card</layer>
- <id>1</id>
- <text>Break</text>
- </content>
- <content>
- <layer>background</layer>
- <id>9</id>
- <text>pascal void MyBreakProc(
- long duration,
- long refCon)
- {
- long a5;
-
- a5 = SetA5(refCon);
- CMBreak(gConnection, duration, false, nil);
- (void) SetA5(a5);
- }
- </text>
- </content>
- <name>break</name>
- <script></script>
- </card>
-
-
- card_13679.xml
- <?xml version="1.0" encoding="utf-8" ?>
- <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
- <card>
- <id>13679</id>
- <filler1>0</filler1>
- <cantDelete> <false /> </cantDelete>
- <showPict> <true /> </showPict>
- <dontSearch> <false /> </dontSearch>
- <owner>7555</owner>
- <link rel="stylesheet" type="text/css" href="stylesheet_3084.css" />
- <part>
- <id>1</id>
- <type>field</type>
- <visible> <true /> </visible>
- <dontWrap> <false /> </dontWrap>
- <dontSearch> <false /> </dontSearch>
- <sharedText> <false /> </sharedText>
- <fixedLineHeight> <false /> </fixedLineHeight>
- <autoTab> <false /> </autoTab>
- <lockText> <true /> </lockText>
- <rect>
- <left>373</left>
- <top>24</top>
- <right>467</right>
- <bottom>41</bottom>
- </rect>
- <style>opaque</style>
- <autoSelect> <false /> </autoSelect>
- <showLines> <false /> </showLines>
- <wideMargins> <false /> </wideMargins>
- <multipleLines> <false /> </multipleLines>
- <reservedFamily> 0 </reservedFamily>
- <titleWidth>0</titleWidth>
- <icon>0</icon>
- <textAlign>center</textAlign>
- <font>Chicago</font>
- <textSize>12</textSize>
- <textStyle>plain</textStyle>
- <textHeight>16</textHeight>
- <name></name>
- <script></script>
- </part>
- <content>
- <layer>card</layer>
- <id>1</id>
- <text>Environment</text>
- </content>
- <content>
- <layer>background</layer>
- <id>9</id>
- <text>pascal CMErr MyEnvironProc(
- long refCon,
- ConnEnvironRec *environ)
- {
- OSErr error;
- long a5;
-
- a5 = SetA5(refCon);
- error = CMGetConnEnvirons(
- gConnection, environ);
- (void) SetA5(a5);
- return error;
- }
- </text>
- </content>
- <name>environment</name>
- <script></script>
- </card>
-
-
- card_10250.xml
- <?xml version="1.0" encoding="utf-8" ?>
- <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
- <card>
- <id>10250</id>
- <filler1>0</filler1>
- <cantDelete> <false /> </cantDelete>
- <showPict> <true /> </showPict>
- <dontSearch> <false /> </dontSearch>
- <owner>7555</owner>
- <link rel="stylesheet" type="text/css" href="stylesheet_3084.css" />
- <part>
- <id>1</id>
- <type>field</type>
- <visible> <true /> </visible>
- <dontWrap> <false /> </dontWrap>
- <dontSearch> <false /> </dontSearch>
- <sharedText> <false /> </sharedText>
- <fixedLineHeight> <false /> </fixedLineHeight>
- <autoTab> <false /> </autoTab>
- <lockText> <true /> </lockText>
- <rect>
- <left>377</left>
- <top>24</top>
- <right>454</right>
- <bottom>41</bottom>
- </rect>
- <style>opaque</style>
- <autoSelect> <false /> </autoSelect>
- <showLines> <false /> </showLines>
- <wideMargins> <false /> </wideMargins>
- <multipleLines> <false /> </multipleLines>
- <reservedFamily> 0 </reservedFamily>
- <titleWidth>0</titleWidth>
- <icon>0</icon>
- <textAlign>center</textAlign>
- <font>Chicago</font>
- <textSize>12</textSize>
- <textStyle>plain</textStyle>
- <textHeight>16</textHeight>
- <name></name>
- <script></script>
- </part>
- <content>
- <layer>card</layer>
- <id>1</id>
- <text>Click Loop</text>
- </content>
- <content>
- <layer>background</layer>
- <id>9</id>
- <text>pascal Boolean MyClickLoop(long refCon)
- {
- long a5;
-
- a5 = SetA5(refCon);
-
- /* This is really hard */
- /* Surfer Plus is the only sample available */
-
- (void) SetA5(a5);
- return false;
- }
- </text>
- </content>
- <name>Click</name>
- <script></script>
- </card>
-
-
- card_11025.xml
- <?xml version="1.0" encoding="utf-8" ?>
- <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
- <card>
- <id>11025</id>
- <filler1>0</filler1>
- <cantDelete> <false /> </cantDelete>
- <showPict> <true /> </showPict>
- <dontSearch> <false /> </dontSearch>
- <owner>7555</owner>
- <link rel="stylesheet" type="text/css" href="stylesheet_3084.css" />
- <part>
- <id>1</id>
- <type>field</type>
- <visible> <true /> </visible>
- <dontWrap> <false /> </dontWrap>
- <dontSearch> <false /> </dontSearch>
- <sharedText> <false /> </sharedText>
- <fixedLineHeight> <false /> </fixedLineHeight>
- <autoTab> <false /> </autoTab>
- <lockText> <true /> </lockText>
- <rect>
- <left>384</left>
- <top>24</top>
- <right>449</right>
- <bottom>41</bottom>
- </rect>
- <style>opaque</style>
- <autoSelect> <false /> </autoSelect>
- <showLines> <false /> </showLines>
- <wideMargins> <false /> </wideMargins>
- <multipleLines> <false /> </multipleLines>
- <reservedFamily> 0 </reservedFamily>
- <titleWidth>0</titleWidth>
- <icon>0</icon>
- <textAlign>center</textAlign>
- <font>Chicago</font>
- <textSize>12</textSize>
- <textStyle>plain</textStyle>
- <textHeight>16</textHeight>
- <name></name>
- <script></script>
- </part>
- <content>
- <layer>card</layer>
- <id>1</id>
- <text>Caching</text>
- </content>
- <content>
- <layer>background</layer>
- <id>9</id>
- <text>pascal long MyCacheProc(
- long refCon,
- TermDataBlock *termData)
- {
- long a5;
-
- a5 = SetA5(refCon);
-
- HLock((*termData).theData);
- BlockMove(
- *(*termData).theData,
- &gCache[gCacheTop],
- GetHandleSize((*termData).theData));
- HUnlock((*termData).theData);
-
- ++gCacheTop;
- if (kCacheMax == gCacheTop)
- {
- gCacheTop = kCacheMin;
- }
-
- (void) SetA5(a5);
- return tmNoErr;
- }
- </text>
- </content>
- <name>Caching</name>
- <script></script>
- </card>
-
-
- card_10992.xml
- <?xml version="1.0" encoding="utf-8" ?>
- <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
- <card>
- <id>10992</id>
- <filler1>0</filler1>
- <cantDelete> <false /> </cantDelete>
- <showPict> <true /> </showPict>
- <dontSearch> <false /> </dontSearch>
- <owner>7555</owner>
- <link rel="stylesheet" type="text/css" href="stylesheet_3084.css" />
- <part>
- <id>1</id>
- <type>field</type>
- <visible> <true /> </visible>
- <dontWrap> <false /> </dontWrap>
- <dontSearch> <false /> </dontSearch>
- <sharedText> <false /> </sharedText>
- <fixedLineHeight> <false /> </fixedLineHeight>
- <autoTab> <false /> </autoTab>
- <lockText> <true /> </lockText>
- <rect>
- <left>368</left>
- <top>24</top>
- <right>475</right>
- <bottom>41</bottom>
- </rect>
- <style>opaque</style>
- <autoSelect> <false /> </autoSelect>
- <showLines> <false /> </showLines>
- <wideMargins> <false /> </wideMargins>
- <multipleLines> <false /> </multipleLines>
- <reservedFamily> 0 </reservedFamily>
- <titleWidth>0</titleWidth>
- <icon>0</icon>
- <textAlign>center</textAlign>
- <font>Chicago</font>
- <textSize>12</textSize>
- <textStyle>plain</textStyle>
- <textHeight>16</textHeight>
- <name></name>
- <script></script>
- </part>
- <content>
- <layer>card</layer>
- <id>1</id>
- <text>Receiving Data</text>
- </content>
- <content>
- <layer>background</layer>
- <id>9</id>
- <text>This is not really a callback made by the Terminal Manager. You have to call it in the event loop.
-
- OSErr MyRecvProc()
- {
- OSErr error;
- CMBufferSizes sizes;
- CMStatFlags status;
- Str255 buffer;
- long tmCount;
- long cmCount;
- CMFlags cmFlags;
-
- error = CMStatus(gConnection, &sizes, &status);
- if (noErr == error)
- {
- if (status & cmStatusOpen)
- {
- if (status & cmStatusDataAvail)
- {
- cmCount = min(
- sizeof(buffer),
- sizes[cmDataIn]);
- error = CMRead(
- gConnection,
- buffer,
- &cmCount,
- cmData,
- false,
- nil,
- 0,
- &cmFlags);
- if (noErr == error)
- {
- tmCount = TMStream(
- gTerminal,
- buffer,
- cmCount,
- cmFlags);
- }
- }
- }
- }
- return error;
- }
- </text>
- </content>
- <name>Receiving</name>
- <script></script>
- </card>
-
-
- card_10533.xml
- <?xml version="1.0" encoding="utf-8" ?>
- <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
- <card>
- <id>10533</id>
- <filler1>0</filler1>
- <cantDelete> <false /> </cantDelete>
- <showPict> <true /> </showPict>
- <dontSearch> <false /> </dontSearch>
- <owner>7555</owner>
- <link rel="stylesheet" type="text/css" href="stylesheet_3084.css" />
- <part>
- <id>1</id>
- <type>field</type>
- <visible> <true /> </visible>
- <dontWrap> <false /> </dontWrap>
- <dontSearch> <false /> </dontSearch>
- <sharedText> <false /> </sharedText>
- <fixedLineHeight> <false /> </fixedLineHeight>
- <autoTab> <false /> </autoTab>
- <lockText> <true /> </lockText>
- <rect>
- <left>365</left>
- <top>24</top>
- <right>463</right>
- <bottom>41</bottom>
- </rect>
- <style>opaque</style>
- <autoSelect> <false /> </autoSelect>
- <showLines> <false /> </showLines>
- <wideMargins> <false /> </wideMargins>
- <multipleLines> <false /> </multipleLines>
- <reservedFamily> 0 </reservedFamily>
- <titleWidth>0</titleWidth>
- <icon>0</icon>
- <textAlign>center</textAlign>
- <font>Chicago</font>
- <textSize>12</textSize>
- <textStyle>plain</textStyle>
- <textHeight>16</textHeight>
- <name></name>
- <script></script>
- </part>
- <content>
- <layer>card</layer>
- <id>1</id>
- <text>Sending Data</text>
- </content>
- <content>
- <layer>background</layer>
- <id>9</id>
- <text>pascal long MySendProc (
- Ptr ptr,
- long size,
- long refCon,
- short flags)
- {
- OSErr error;
- long a5;
-
- a5 = SetA5(refCon);
-
- error = CMWrite(
- gConnection,
- ptr,
- &size,
- cmData,
- false,
- nil,
- 0,
- flags);
-
- (void) SetA5(a5);
- return noErr == error ? size : 0;
- }
- </text>
- </content>
- <name>Sending</name>
- <script></script>
- </card>
-
-
- card_7926.xml
- <?xml version="1.0" encoding="utf-8" ?>
- <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
- <card>
- <id>7926</id>
- <filler1>0</filler1>
- <cantDelete> <false /> </cantDelete>
- <showPict> <true /> </showPict>
- <dontSearch> <false /> </dontSearch>
- <owner>7555</owner>
- <link rel="stylesheet" type="text/css" href="stylesheet_3084.css" />
- <part>
- <id>1</id>
- <type>field</type>
- <visible> <true /> </visible>
- <dontWrap> <false /> </dontWrap>
- <dontSearch> <false /> </dontSearch>
- <sharedText> <false /> </sharedText>
- <fixedLineHeight> <false /> </fixedLineHeight>
- <autoTab> <false /> </autoTab>
- <lockText> <true /> </lockText>
- <rect>
- <left>346</left>
- <top>24</top>
- <right>479</right>
- <bottom>41</bottom>
- </rect>
- <style>opaque</style>
- <autoSelect> <false /> </autoSelect>
- <showLines> <false /> </showLines>
- <wideMargins> <false /> </wideMargins>
- <multipleLines> <false /> </multipleLines>
- <reservedFamily> 0 </reservedFamily>
- <titleWidth>0</titleWidth>
- <icon>0</icon>
- <textAlign>center</textAlign>
- <font>Chicago</font>
- <textSize>12</textSize>
- <textStyle>plain</textStyle>
- <textHeight>16</textHeight>
- <name></name>
- <script></script>
- </part>
- <part>
- <id>2</id>
- <type>field</type>
- <visible> <false /> </visible>
- <dontWrap> <false /> </dontWrap>
- <dontSearch> <false /> </dontSearch>
- <sharedText> <false /> </sharedText>
- <fixedLineHeight> <false /> </fixedLineHeight>
- <autoTab> <false /> </autoTab>
- <lockText> <true /> </lockText>
- <rect>
- <left>130</left>
- <top>280</top>
- <right>576</right>
- <bottom>352</bottom>
- </rect>
- <style>scrolling</style>
- <autoSelect> <false /> </autoSelect>
- <showLines> <false /> </showLines>
- <wideMargins> <false /> </wideMargins>
- <multipleLines> <false /> </multipleLines>
- <reservedFamily> 0 </reservedFamily>
- <titleWidth>0</titleWidth>
- <icon>0</icon>
- <textAlign>left</textAlign>
- <font>Geneva</font>
- <textSize>9</textSize>
- <textStyle>plain</textStyle>
- <textHeight>12</textHeight>
- <name>the 411 info</name>
- <script></script>
- </part>
- <content>
- <layer>card</layer>
- <id>1</id>
- <text>Terminal Callbacks</text>
- </content>
- <content>
- <layer>card</layer>
- <id>2</id>
- <text>√¶KY CMWrite
- Writing data
-
- Function CMWrite(hConn: ConnHandle; theBuffer: Ptr; VAR toWrite:
- LONGINT; theChannel: CMChannel; async: BOOLEAN;
- completor: ProcPtr; timeout: LONGINT; flags: CMFlags):
- CMErr;
-
- Description: CMWrite writes data from a block of memory. Your
- application cannot queue multiple write requests for the
- same channel on the same connection. However, your
- application can have both a pending read and a pending
- write on the same channel at the same time. Your
- application can call this routine at interrupt level.
-
- Note: Your application should not check for an open
- channel prior to writing data. The connection tool might
- be interpreting data locally and,therefore, not need an
- open connection.
-
- theBuffer specifies the buffer from which the connection
- gets the data to write.
-
- toWrite specifies the number of bytes to be written. If
- your application calls this routine synchronously, the
- connection tool returns the actual number of bytes it
- wrote in toWrite. Your application can call CMStatus to
- see if an asynchronous write is pending. If your
- application calls this routine asynchronously, the
- asyncCount field of the connection record contains the
- actual number of bytes written when the completion
- routine is called.
-
- theChannel specifies the channel on which writing takes
- place. Acceptable values are as follows:
-
- CONST
- cmData = $00000001;
- cmCntl = $00000002;
- cmAttn = $00000004;
-
- async specifies whether or not the request is
- asynchronous. If your application makes an asynchronous
- request, CMWrite returns cmNoErr immediately.
-
- completor specifies the completion routine to be called
- upon completion of an asynchronous write request.
- Completion routines are discussed in greater detail
- later in this chapter in the section “Completion
- Routines.”
-
- timeout specifies a time period, in ticks, within which
- the connection tool must complete the write operation.
- If it does not finish within thespecified period, a
- timeout error occurs. For no timeout, use –1. If your
- application specifies 0, the connection tool writes as
- many bytes, up to toWrite bytes, as it can in one write
- attempt. Some connection tools ignore this parameter.
-
- flags indicates whether the connection tool should send
- an end-of-message indicator. An end-of-message indicator
- needs to be supported by the particular communications
- protocol being used; if an end-of-message indicator is
- not supported by the connection protocol, your
- application should ignore this field.
-
- CONST
- cmFlagsEOM = $0001;
-
-
- Result Codes cmGenericError, cmNoErr, cmRejected, cmFailed, cmTimeout,
- cmNotOpen, cmNoRequestPending, cmNotSupported.
- •
- √¶KY CMStatus
- Getting connection status information
-
- Function CMStatus(hConn: ConnHandle; VAR sizes: CMBufferSizes;
- VAR flags: CMStatFlags): CMErr;
-
- Description: CMStatus returns a variety of useful status information
- about a connection. Your application can call this
- routine at interrupt level.
-
- sizes is a variable of type CMBufferSizes that contains
- the number of characters to be read or written on the
- data, control, and attention channels. The indexes of
- the array are as follows:
-
- cmDataIn, cmDataOut, cmCntlIn, cmCntlOut, cmAttnIn,
- cmAttnOut, cmRsrvIn, cmRsrvOut.
-
- flags is a bit field with the following masks:
-
- CONST
- {tool is opening connection}
- cmStatusOpening = $00000001;
- {connection is open}
- cmStatusOpen = $00000002;
- {tool is closing connection}
- cmStatusClosing = $00000004;
- {data present on data channel}
- cmStatusDataAvail = $00000008;
- {data present on cntl channel}
- cmStatusCntlAvail = $00000010;
- {data present on attn channel}
- cmStatusAttnAvail = $00000020;
- {data read pending}
- cmStatusDRPend = $00000040;
- {data write pending}
- cmStatusDWPend = $00000080;
- {cntl read pending}
- cmStatusCRPend = $00000100;
- {cntl write pending}
- cmStatusCWPend = $00000200;
- {attn read pending}
- cmStatusARPend = $00000400;
- {attn write pending}
- cmStatusAWPend = $00000800;
- {tool is breaking the connection}
- cmStatusBreakPending = $00001000;
- {tool is “listening” for data}
- cmStatusListenPend = $00002000;
- {call waiting for tool to handle}
- cmStatusIncomingCallPresent = $00004000;
-
-
- TYPE
- CMStatFlags = LONGINT;
-
-
- Result Codes cmGenericError, cmNoErr, cmNotSupported.
- •
- √¶KY CMRead
- Reading data
-
- Function CMRead(hConn: ConnHandle; theBuffer: Ptr; VAR toRead:
- LONGINT; theChannel: CMChannel; async: BOOLEAN;
- completor: ProcPtr; timeout: LONGINT; VAR flags:
- CMFlags): CMErr;
-
- Description: CMRead reads data into a block of memory. Your
- application cannot queue multiple read requests for the
- same channel on the same connection. However, your
- application can have both a pending read and a pending
- write on the same channel at the same time. Your
- application can call this routine at interrupt level.
-
- Note: Your application should not check for an open
- channel prior to reading data. The connection tool might
- be interpreting data locally and, therefore, not need an
- open connection.
-
- theBuffer specifies the buffer to which the connection
- tool should read data.
-
- toRead specifies the number of bytes to be read. If your
- application calls this routine synchronously, the
- connection tool returns the actual number of bytes it
- read in toRead. Your application can call CMStatus to
- see if an asynchronous read is pending. If your
- application calls this routine asynchronously, the
- asyncCount field of the connection record contains the
- actual number of bytes read when the connection tool
- calls the completion routine.
-
- theChannel specifies the channel on which reading takes
- place. Acceptable values are as follows:
-
- CONST
- cmData = $00000001;
- cmCntl = $00000002;
- cmAttn = $00000004;
-
- async specifies whether or not the request is
- asynchronous. If an asynchronous request is made,
- cmNoErr is returned immediately.
-
- completor specifies the completion routine to be called
- upon completion of an asynchronous read request.
- Completion routines are discussed in greater detail
- later in this chapter in the section “Completion
- Routines.”
-
- timeout specifies a time period, in ticks, within which
- the connection tool must complete the read operation. If
- it does not finish within the specified time, a timeout
- error occurs. For no timeout, use –1. If your
- application specifies 0, the connection tool reads as
- many bytes, up to toRead bytes, as it can in one read
- attempt. Some connection tools ignore this parameter.
-
- flags indicates whether your application received an
- end-of-message indicator. If your application calls this
- routine asynchronously, the connection tool returns the
- end of message indicator in the reserved0 field of the
- connection record when the completion routine is called.
-
- CONST
- cmFlagsEOM = $0001;
-
-
- Result Codes cmGenericError, cmNoErr, cmRejected, cmFailed, cmTimeout,
- cmNotOpen, cmNoRequestPending, cmNotSupported.
- •
- √¶KY CMGetConnEnvirons
- Getting the connection environment
-
- Function CMGetConnEnvirons (hConn : ConnHandle; VAR theEnvirons :
- ConnEnvironRec) : CMErr;
-
- Description: CMGetConnEnvirons provides a means for obtaining
- connection environment information.
-
- CMGetConnEnvirons returns the connection environment
- record in theEnvirons for the connection specified by
- ConnHandle. The connection tool is responsible for
- filling in each field of ConnEnvironRec with either a
- value (if it has a valid value to supply) or 0.
- The structure for version 0 of the connection
- environment record is as follows:
-
- TYPE
- ConnEnvironRecPtr = ^ConnEnvironRec;
- ConnEnvironRec = RECORD;
- version : INTEGER;
- {version of this data structure}
- baudRate : LONGINT;
- {data transfer rate}
- dataBits : INTEGER;
- {number of significant bits per byte}
- channels : CMChannel;
- {supported channels}
- swFlowControl : BOOLEAN;
- {if software flow control is in use}
- hwFlowControl : BOOLEAN;
- {if hardware flow control is in use}
- flags : CMFlags;
- END;
-
- The version field takes on the following value:
-
- CONST
- curConnEnvRecVers = 0;
-
- The flags field of the ConnEnvironRec is a bit field
- with the following value:
-
- TYPE
- CMFlags = INTEGER;
-
- CONST
- cmFlagsEOM = $0001;
-
- Other bits of flags are reserved by Apple Computer, Inc.
-
- channels is a bit field with the following values:
-
- TYPE
- CMChannel = INTEGER;
-
- CONST
- cmData = $00000001;
- cmCntl = $00000002;
- cmAttn = $00000004;
-
- cmDataClean = $00000100;
- cmCntlClean = $00000200;
- cmAttnClean = $00000400;
-
- Other bits of channels are reserved by Apple Computer,
- Inc.
-
-
- Result Codes cmGenericError, cmNoErr, cmNotSupported, envVersTooBig
- •
- √¶KY CMBreak
- Sending breaks
-
- Procedure CMBreak(hConn: ConnHandle; duration: LONGINT; async:
- BOOLEAN; completor: ProcPtr);
-
- Description: CMBreak effects a break operation upon the connection.
- The exact effect of this operation depends upon the tool
- in use.
-
- duration specifies in ticks the length of the break.
-
- completor specifies the completion routine to be called
- upon completion of the break. Completion routines are
- called only after asynchronous calls to CMBreak.
- “Completion Routines,” later in this chapter, discusses
- completion routines in more detail.
- •
- √¶KY TMStream
- Putting data into the terminal
-
- Function TMStream(hTerm: TermHandle; theBuffer: Ptr; theLength:
- LONGINT; flags: CMFlags): LONGINT;
-
- Description: Your application should use TMStream to give the
- terminal tool data to write into the terminal emulation
- buffer.
-
- TMStream returns the number of bytes that it processed.
-
- theBuffer is the data that is either to be placed in the
- terminal emulation buffer or processed by the terminal
- tool. Typically the data theBuffer points to has been
- provided by the connection tool your application is
- using.
- •
- </text>
- </content>
- <name>Callbacks</name>
- <script></script>
- </card>
-
-
- card_7414.xml
- <?xml version="1.0" encoding="utf-8" ?>
- <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
- <card>
- <id>7414</id>
- <filler1>0</filler1>
- <cantDelete> <false /> </cantDelete>
- <showPict> <true /> </showPict>
- <dontSearch> <false /> </dontSearch>
- <owner>5862</owner>
- <link rel="stylesheet" type="text/css" href="stylesheet_3084.css" />
- <part>
- <id>1</id>
- <type>field</type>
- <visible> <true /> </visible>
- <dontWrap> <false /> </dontWrap>
- <dontSearch> <false /> </dontSearch>
- <sharedText> <false /> </sharedText>
- <fixedLineHeight> <false /> </fixedLineHeight>
- <autoTab> <false /> </autoTab>
- <lockText> <true /> </lockText>
- <rect>
- <left>336</left>
- <top>24</top>
- <right>492</right>
- <bottom>41</bottom>
- </rect>
- <style>opaque</style>
- <autoSelect> <false /> </autoSelect>
- <showLines> <false /> </showLines>
- <wideMargins> <false /> </wideMargins>
- <multipleLines> <false /> </multipleLines>
- <reservedFamily> 0 </reservedFamily>
- <titleWidth>0</titleWidth>
- <icon>0</icon>
- <textAlign>center</textAlign>
- <font>Chicago</font>
- <textSize>12</textSize>
- <textStyle>plain</textStyle>
- <textHeight>16</textHeight>
- <name></name>
- <script></script>
- </part>
- <content>
- <layer>background</layer>
- <id>5</id>
- <text>unsigned char flags;
-
- flags = HGetState((Handle) terminal);
- HLock((Handle) terminal);
- BlockMove(
- (**terminal).config,
- (**terminal).oldConfig,
- GetPtrSize((**terminal).oldConfig));
- HSetState((Handle) terminal, flags);
-
-
-
-
- </text>
- </content>
- <content>
- <layer>card</layer>
- <id>1</id>
- <text>Configuration Records</text>
- </content>
- <name>Configuration Records</name>
- <script></script>
- </card>
-
-
- card_6947.xml
- <?xml version="1.0" encoding="utf-8" ?>
- <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
- <card>
- <id>6947</id>
- <filler1>0</filler1>
- <cantDelete> <false /> </cantDelete>
- <showPict> <true /> </showPict>
- <dontSearch> <false /> </dontSearch>
- <owner>5862</owner>
- <link rel="stylesheet" type="text/css" href="stylesheet_3084.css" />
- <part>
- <id>1</id>
- <type>field</type>
- <visible> <true /> </visible>
- <dontWrap> <false /> </dontWrap>
- <dontSearch> <false /> </dontSearch>
- <sharedText> <false /> </sharedText>
- <fixedLineHeight> <false /> </fixedLineHeight>
- <autoTab> <false /> </autoTab>
- <lockText> <true /> </lockText>
- <rect>
- <left>340</left>
- <top>24</top>
- <right>492</right>
- <bottom>41</bottom>
- </rect>
- <style>opaque</style>
- <autoSelect> <false /> </autoSelect>
- <showLines> <false /> </showLines>
- <wideMargins> <false /> </wideMargins>
- <multipleLines> <false /> </multipleLines>
- <reservedFamily> 0 </reservedFamily>
- <titleWidth>0</titleWidth>
- <icon>0</icon>
- <textAlign>center</textAlign>
- <font>Chicago</font>
- <textSize>12</textSize>
- <textStyle>plain</textStyle>
- <textHeight>16</textHeight>
- <name></name>
- <script></script>
- </part>
- <content>
- <layer>card</layer>
- <id>1</id>
- <text>Configuration Strings</text>
- </content>
- <content>
- <layer>background</layer>
- <id>5</id>
- <text>OSErr ResetConfig(TermHandle terminal)
- {
- OSErr error;
- Handle configStr;
-
- configStr = Get1Resource('CSTR', kConfigStrID);
- if (nil == configStr)
- {
- error = ResError();
- if (noErr == error)
- {
- error = resNotFound;
- }
- return error;
- }
- MoveHHi(configStr);
- HLock(configStr);
- error = TMSetConfig(terminal, *configStr);
- HUnlock(configStr);
- ReleaseResource(configStr);
- return error;
- }
- </text>
- </content>
- <name>Configuration Strings</name>
- <script></script>
- </card>
-
-
- card_6861.xml
- <?xml version="1.0" encoding="utf-8" ?>
- <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
- <card>
- <id>6861</id>
- <filler1>0</filler1>
- <cantDelete> <false /> </cantDelete>
- <showPict> <true /> </showPict>
- <dontSearch> <false /> </dontSearch>
- <owner>5862</owner>
- <link rel="stylesheet" type="text/css" href="stylesheet_3084.css" />
- <part>
- <id>1</id>
- <type>field</type>
- <visible> <true /> </visible>
- <dontWrap> <false /> </dontWrap>
- <dontSearch> <false /> </dontSearch>
- <sharedText> <false /> </sharedText>
- <fixedLineHeight> <false /> </fixedLineHeight>
- <autoTab> <false /> </autoTab>
- <lockText> <true /> </lockText>
- <rect>
- <left>365</left>
- <top>24</top>
- <right>466</right>
- <bottom>41</bottom>
- </rect>
- <style>opaque</style>
- <autoSelect> <false /> </autoSelect>
- <showLines> <false /> </showLines>
- <wideMargins> <false /> </wideMargins>
- <multipleLines> <false /> </multipleLines>
- <reservedFamily> 0 </reservedFamily>
- <titleWidth>0</titleWidth>
- <icon>0</icon>
- <textAlign>center</textAlign>
- <font>Chicago</font>
- <textSize>12</textSize>
- <textStyle>plain</textStyle>
- <textHeight>16</textHeight>
- <name></name>
- <script></script>
- </part>
- <content>
- <layer>card</layer>
- <id>1</id>
- <text>Custom Dialog</text>
- </content>
- <content>
- <layer>background</layer>
- <id>5</id>
- <text>TMSetupCleanup
- TMSetupFilter
- TMSetupItem
- TMSetupPostflight
- TMSetupPreFlight
- TMSetupSetup
-
-
-
- </text>
- </content>
- <name>Custom</name>
- <script></script>
- </card>
-
-
- card_6449.xml
- <?xml version="1.0" encoding="utf-8" ?>
- <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
- <card>
- <id>6449</id>
- <filler1>0</filler1>
- <cantDelete> <false /> </cantDelete>
- <showPict> <true /> </showPict>
- <dontSearch> <false /> </dontSearch>
- <owner>5862</owner>
- <link rel="stylesheet" type="text/css" href="stylesheet_3084.css" />
- <part>
- <id>1</id>
- <type>field</type>
- <visible> <true /> </visible>
- <dontWrap> <false /> </dontWrap>
- <dontSearch> <false /> </dontSearch>
- <sharedText> <false /> </sharedText>
- <fixedLineHeight> <false /> </fixedLineHeight>
- <autoTab> <false /> </autoTab>
- <lockText> <true /> </lockText>
- <rect>
- <left>365</left>
- <top>24</top>
- <right>466</right>
- <bottom>41</bottom>
- </rect>
- <style>opaque</style>
- <autoSelect> <false /> </autoSelect>
- <showLines> <false /> </showLines>
- <wideMargins> <false /> </wideMargins>
- <multipleLines> <false /> </multipleLines>
- <reservedFamily> 0 </reservedFamily>
- <titleWidth>0</titleWidth>
- <icon>0</icon>
- <textAlign>center</textAlign>
- <font>Chicago</font>
- <textSize>12</textSize>
- <textStyle>plain</textStyle>
- <textHeight>16</textHeight>
- <name></name>
- <script></script>
- </part>
- <content>
- <layer>card</layer>
- <id>1</id>
- <text>Choose Dialog</text>
- </content>
- <content>
- <layer>background</layer>
- <id>5</id>
- <text>error = TMChoose(&terminal, where, nil);
- if (chooseDisaster == error)
- {
- Fail("\pTMChoose", error);
- }
- else
- if (chooseOKMinor == error)
- {
- UseResFile(gDocFile);
- error = TerminalSave(terminal);
- ErrorMessage("\pTerminalSave", error);
- }
- else
- if (chooseOKMajor == error)
- {
- UseResFile(gDocFile);
- error = TerminalSave(terminal);
- ErrorMessage("\pTerminalSave", error);
- }
- </text>
- </content>
- <name>Choose</name>
- <script></script>
- </card>
-
-
- card_5945.xml
- <?xml version="1.0" encoding="utf-8" ?>
- <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
- <card>
- <id>5945</id>
- <filler1>0</filler1>
- <cantDelete> <false /> </cantDelete>
- <showPict> <true /> </showPict>
- <dontSearch> <false /> </dontSearch>
- <owner>5862</owner>
- <link rel="stylesheet" type="text/css" href="stylesheet_3084.css" />
- <part>
- <id>1</id>
- <type>field</type>
- <visible> <false /> </visible>
- <dontWrap> <false /> </dontWrap>
- <dontSearch> <false /> </dontSearch>
- <sharedText> <false /> </sharedText>
- <fixedLineHeight> <false /> </fixedLineHeight>
- <autoTab> <false /> </autoTab>
- <lockText> <true /> </lockText>
- <rect>
- <left>130</left>
- <top>280</top>
- <right>576</right>
- <bottom>352</bottom>
- </rect>
- <style>scrolling</style>
- <autoSelect> <false /> </autoSelect>
- <showLines> <false /> </showLines>
- <wideMargins> <false /> </wideMargins>
- <multipleLines> <false /> </multipleLines>
- <reservedFamily> 0 </reservedFamily>
- <titleWidth>0</titleWidth>
- <icon>0</icon>
- <textAlign>left</textAlign>
- <font>Geneva</font>
- <textSize>9</textSize>
- <textStyle>plain</textStyle>
- <textHeight>12</textHeight>
- <name>the 411 info</name>
- <script></script>
- </part>
- <part>
- <id>2</id>
- <type>field</type>
- <visible> <true /> </visible>
- <dontWrap> <false /> </dontWrap>
- <dontSearch> <false /> </dontSearch>
- <sharedText> <false /> </sharedText>
- <fixedLineHeight> <false /> </fixedLineHeight>
- <autoTab> <false /> </autoTab>
- <lockText> <true /> </lockText>
- <rect>
- <left>333</left>
- <top>24</top>
- <right>495</right>
- <bottom>41</bottom>
- </rect>
- <style>opaque</style>
- <autoSelect> <false /> </autoSelect>
- <showLines> <false /> </showLines>
- <wideMargins> <false /> </wideMargins>
- <multipleLines> <false /> </multipleLines>
- <reservedFamily> 0 </reservedFamily>
- <titleWidth>0</titleWidth>
- <icon>0</icon>
- <textAlign>center</textAlign>
- <font>Chicago</font>
- <textSize>12</textSize>
- <textStyle>plain</textStyle>
- <textHeight>16</textHeight>
- <name></name>
- <script></script>
- </part>
- <content>
- <layer>card</layer>
- <id>2</id>
- <text>Configuring a Terminal</text>
- </content>
- <content>
- <layer>card</layer>
- <id>1</id>
- <text><span class="style15">KY Get1Resource
- Get1Resource is the same as GetResource except that it searches the current resource
- file only.
- </span><span class="style1">•
- </span><span class="style15">√¶KY TMChoose
- Configuring a terminal tool
-
- Function TMChoose(VAR hTerm: TermHandle; where: Point; idleProc:
- ProcPtr): INTEGER;
-
- Description: An application can configure a terminal tool in one of
- three ways. The easiest and most straightforward way is
- by calling the TMChoose routine. This routine presents
- the user with a dialog box.
- The second way an application can configure a
- terminal tool is by presenting the user with a custom
- tool-settings dialog box. This method is much more
- difficult and involves calling six routines. The
- routines are described in the next section, “Custom
- Configuration of a Terminal Tool,” and “The Custom
- Tool-Settings Dialog Box” in Appendix C provides
- example code.
- The third way your application can configure a
- terminal tool is by using the scripting language
- interface, described in “Interfacing with a Scripting
- Language,” later in this chapter. This method allows
- your application to bypass user interface elements.
-
- where is the point specified in global coordinates,
- where the upper-left corner of the dialog box should
- appear. It is recommended that your application place
- the dialog box as close to the upper-left corner of the
- screen as possible because the size of the dialog box
- varies from tool to tool.
-
- idleProc is a procedure with no parameters that the
- Terminal Manager will automatically call every time
- TMChoose loops through the setup dialog box filter
- procedure. Pass NIL if your application has no idleProc.
-
- TMChoose returns one of the following values:
-
- CONST
- chooseDisaster = -2;
- choose Failed = -1;
- chooseOKMinor = 1;
- chooseOKMajor = 2;
- chooseCancel = 3;
-
- chooseDisaster means that the TMChoose operation failed, destroyed
- the terminal record, and returned NIL in the terminal handle.
- chooseFailed means that the TMChoose operation failed and the
- terminal record was not changed.
- chooseOKMinor means that the user clicked OK in the dialog box, but
- did not change the terminal tool being used.
- chooseOKMajor means that the user clicked OK in the dialog box and
- also changed the terminal tool being used. The Terminal Manager then
- destroys the old terminal handle by calling TMDispose, and returns a new
- terminal handle in hTerm.
- chooseCancel means that the user clicked Cancel in the dialog box.
- •
- √¶KY TMSetupCleanup
- Performing clean-up operations
-
- Procedure TMSetupCleanup(procID: INTEGER; theConfig: Ptr; count:
- INTEGER; theDialog: DialogPtr; VAR magicCookie:
- LONGINT);
-
- Description: TMSetupCleanup disposes of any storage allocated in
- TMSetupPreflight and performs other clean-up operations.
- If your application needs to shorten a dialog box, it
- should do so after calling this routine.
-
- procID is the ID for the terminal tool that is being
- configured. Your application should use the same value
- for procID as it passed to TMSetupPreflight.
-
- theConfig is a pointer to the configuration record for
- the tool being configured.
-
- count is the number of the first item in the dialog item
- list appended to the dialog box.
-
- theDialog is the dialog box performing the configuration.
-
- magicCookie is a pointer to private storage for the
- terminal tool.
- •
- √¶KY TMSetupFilter
- Filtering custom tool-settings dialog box events
-
- Function TMSetupFilter(procID: INTEGER; theConfig: Ptr;
- count:INTEGER; theDialog: DialogPtr; VAR theEvent:
- EventRecord; VAR theItem: INTEGER; VAR magicCookie:
- LONGINT): BOOLEAN;
-
- Description: Your application calls TMSetupFilter as a filter
- procedure before it calls the standard modal dialog box
- filter procedure for the custom tool-settings dialog box.
- This routine allows terminal tools to filter events in
- the custom tool-settings dialog box.
-
- procID is the ID for the terminal tool that is being
- configured. Your application should use the same value
- for procID as it passed to TMSetupPreflight.
-
- theConfig is the pointer to the configuration record for
- the tool being configured.
-
- count is the number of the first item in the dialog item
- list appended to the dialog box.
-
- theDialog is the dialog box performing the configuration.
-
- theEvent is the event record for which filtering is to
- take place.
-
- theItem can return the item clicked in the dialog box.
-
- magicCookie is a pointer to private storage for the
- terminal tool.
-
- If the event passed in was handled, TMSetupFilter
- returns TRUE. Otherwise, FALSE indicates that your
- application should perform standard dialog box filtering.
- •
- √¶KY TMSetupItem
- Processing custom tool-settings dialog box events
-
- Procedure TMSetupItem(procID: INTEGER; theConfig: Ptr; count:
- INTEGER; theDialog: DialogPtr; VAR theItem: INTEGER;
- VAR magicCookie: LONGINT);
-
- Description: TMSetupItem processes events for controls in the custom
- tool-settings dialog box.
-
- procID is the ID for the terminal tool being configured.
- Your application should use the same value for procID as
- it passed to TMSetupPreflight.
-
- theConfig is a pointer to the configuration record for
- the tool being configured.
-
- count is the number of the first item in the dialog item
- list appended to the dialog box.
-
- theDialog is the dialog box performing the configuration.
-
- theItem is the item clicked in the dialog box. This
- value can be modified and sent back.
-
- magicCookie is a pointer to private storage for the
- terminal tool.
- •
- √¶KY TMSetupPostFlight
- Closing the tool file
-
- Procedure TMSetupPostflight(procID:INTEGER);
-
- Description: TMSetupPostflight closes the tool file if it is not
- being used by any session.
-
- procID is the ID for the terminal tool that is being
- configured. Your application should use the same value
- for procID as it passed to TMSetupPreflight.
- •
- √¶KY TMSetupPreFlight
- Setting up the custom tool-settings dialog box
-
- Function TMSetupPreflight(procID: INTEGER; VAR magicCookie:
- LONGINT): Handle;
-
- Description: TMSetupPreflight returns a handle to a dialog item list
- that your application appends to the tool-settings
- dialog box. The handle comes from the terminal tool.
- (The calling application uses AppendDITL, which is
- discussed in Chapter 7.) This handle is not a resource
- handle. Your application is responsible for disposing of
- the handle when done with it.
- The terminal tool can use TMSetupPreflight to
- allocate a block of private storage, and to store the
- pointer to that block in magicCookie. magicCookie should
- be passed to the other routines that are used to set up
- the custom tool-settings dialog box.
-
- procID is the ID for the terminal tool that is being
- configured. Your application should get this value by
- using the TMGetProcID routine, which is discussed
- earlier in this chapter.
-
- Note: The refcon of the custom tool-settings dialog
- box should point to a data structure (an example of
- which is shown next) in which the first two bytes are
- the tool procID and the next four bytes are magicCookie.
- UserItem routines, for example, may require procID to
- obtain tool resources.
-
-
- TYPE
- chooseDLOGdata = RECORD
- procID : INTEGER
- magicCookie : LONGINT
- END;
- •
- √¶KY TMSetupSetup
- Setting up the custom tool-settings dialog box items
-
- Procedure TMSetupSetup(procID: INTEGER; theConfig: Ptr; count:
- INTEGER; theDialog: DialogPtr; VAR magicCookie:
- LONGINT);
-
- Description: TMSetupSetup tells the terminal tool to set up controls
- (like radio buttons or check boxes) in the dialog item
- list returned by TMSetupPreflight.
-
- procID is the ID for the terminal tool being configured.
- Your application should use the same value for procID as
- it passed to TMSetupPreflight.
-
- theConfig is a pointer to a configuration record for the
- tool being configured.
-
- count is the number of the first item in the dialog item
- list appended to the dialog box.
-
- theDialog is the dialog box in which configuration is
- taking place.
-
- magicCookie is a pointer to private storage for the terminal tool.
- •
- √¶KY TMSetConfig
- Setting the configuration with a string
-
- Function TMSetConfig(hTerm: TermHandle; thePtr: Ptr): INTEGER;
-
- Description: TMSetConfig passes a configuration string to the
- terminal tool.
-
- TMSetConfig passes a null-terminated, C-style string
- (see the example string later in this section) to the
- terminal tool for parsing. The string is pointed to
- by thePtr and must contain tokens that describe the
- configuration of the terminal record. The string can be
- any length.
-
- TMSetConfig ignores items it does not recognize or
- find relevant; such an occurrence causes the terminal
- tool to stop parsing the string and to return the
- character position where the error occurred. If the
- terminal tool successfully parses the string, it returns
- tmNoErr. If the terminal tool does not successfully
- parse the string, it returns one of the following values:
- a number less than –1 to indicate an OSErr, –1 to
- indicate an unknown error, or a positive number to
- indicate the character position where parsing was
- stopped.
- Individual terminal tools are responsible for the
- parsing operation.
-
- Sample: A null-terminated, C-style configuration string
-
- FontSize 9 Width 80 Cursor Underline Online True
- LocalEcho False AutoRepeat True RepeatControls False
- AutoWrap False NewLine False SmoothScroll False
- Transparent False SwapBSDelete False\0
- •
-
- </span></text>
- </content>
- <name>Configuring</name>
- <script></script>
- </card>
-
-
- card_5515.xml
- <?xml version="1.0" encoding="utf-8" ?>
- <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
- <card>
- <id>5515</id>
- <filler1>0</filler1>
- <cantDelete> <false /> </cantDelete>
- <showPict> <true /> </showPict>
- <dontSearch> <false /> </dontSearch>
- <owner>4094</owner>
- <link rel="stylesheet" type="text/css" href="stylesheet_3084.css" />
- <part>
- <id>1</id>
- <type>field</type>
- <visible> <true /> </visible>
- <dontWrap> <false /> </dontWrap>
- <dontSearch> <false /> </dontSearch>
- <sharedText> <false /> </sharedText>
- <fixedLineHeight> <false /> </fixedLineHeight>
- <autoTab> <false /> </autoTab>
- <lockText> <true /> </lockText>
- <rect>
- <left>378</left>
- <top>24</top>
- <right>454</right>
- <bottom>41</bottom>
- </rect>
- <style>opaque</style>
- <autoSelect> <false /> </autoSelect>
- <showLines> <false /> </showLines>
- <wideMargins> <false /> </wideMargins>
- <multipleLines> <false /> </multipleLines>
- <reservedFamily> 0 </reservedFamily>
- <titleWidth>0</titleWidth>
- <icon>0</icon>
- <textAlign>center</textAlign>
- <font>Chicago</font>
- <textSize>12</textSize>
- <textStyle>plain</textStyle>
- <textHeight>16</textHeight>
- <name></name>
- <script></script>
- </part>
- <content>
- <layer>card</layer>
- <id>1</id>
- <text>Disposing</text>
- </content>
- <content>
- <layer>background</layer>
- <id>5</id>
- <text>void TerminalDispose(TermHandle *terminal)
- {
- if (nil != *terminal)
- {
- TMDispose(*terminal);
- *terminal = nil;
- }
- }
- </text>
- </content>
- <name>Disposing</name>
- <script></script>
- </card>
-
-
- card_15049.xml
- <?xml version="1.0" encoding="utf-8" ?>
- <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
- <card>
- <id>15049</id>
- <filler1>0</filler1>
- <cantDelete> <false /> </cantDelete>
- <showPict> <true /> </showPict>
- <dontSearch> <false /> </dontSearch>
- <owner>4094</owner>
- <link rel="stylesheet" type="text/css" href="stylesheet_3084.css" />
- <part>
- <id>1</id>
- <type>field</type>
- <visible> <true /> </visible>
- <dontWrap> <false /> </dontWrap>
- <dontSearch> <false /> </dontSearch>
- <sharedText> <false /> </sharedText>
- <fixedLineHeight> <false /> </fixedLineHeight>
- <autoTab> <false /> </autoTab>
- <lockText> <true /> </lockText>
- <rect>
- <left>388</left>
- <top>24</top>
- <right>448</right>
- <bottom>41</bottom>
- </rect>
- <style>opaque</style>
- <autoSelect> <false /> </autoSelect>
- <showLines> <false /> </showLines>
- <wideMargins> <false /> </wideMargins>
- <multipleLines> <false /> </multipleLines>
- <reservedFamily> 0 </reservedFamily>
- <titleWidth>0</titleWidth>
- <icon>0</icon>
- <textAlign>center</textAlign>
- <font>Chicago</font>
- <textSize>12</textSize>
- <textStyle>plain</textStyle>
- <textHeight>16</textHeight>
- <name></name>
- <script></script>
- </part>
- <content>
- <layer>card</layer>
- <id>1</id>
- <text>Saving</text>
- </content>
- <content>
- <layer>background</layer>
- <id>5</id>
- <text>OSErr TerminalSave(TermHandle terminal)
- {
- OSErr error;
- Handle h;
- short procID;
- Str255 toolName;
- Ptr configStr;
- unsigned char flags;
-
- h = Get1Resource('STR ', kTMResourceID);
- if (nil != h)
- {
- RmveResource(h);
- DisposeHandle(h);
- }
-
- h = Get1Resource('CSTR', kTMResourceID);
- if (nil != h)
- {
- RmveResource(h);
- DisposeHandle(h);
- }
-
- procID = (**terminal).procID;
- TMGetToolName(procID, toolName);
- error = PtrToHand(toolName, &h, sizeof(toolName));
- if (noErr != error)
- {
- return error;
- }
- AddResource(h, 'STR ',
- kTMResourceID, "\pTerminal Tool Name");
- error = ResError();
- if (noErr != error)
- {
- return error;
- }
- ReleaseResource(h);
-
- configStr = TMGetConfig(terminal);
- if (nil == configStr)
- {
- error = tmGenericError;
- return error;
- }
-
- error = PtrToHand(configStr, &h,
- GetPtrSize(configStr));
- DisposPtr(configStr);
- if (noErr != error)
- {
- return error;
- }
- AddResource(h, 'CSTR',
- kTMResourceID, "\pTerminal Configuration String");
- error = ResError();
- if (noErr != error)
- {
- return error;
- }
- ReleaseResource(h);
-
- flags = HGetState((Handle) terminal);
- HLock((Handle)terminal);
- BlockMove(
- (**terminal).config,
- (**terminal).oldConfig,
- GetPtrSize((**terminal).oldConfig));
- HSetState((Handle)terminal, flags);
-
- return error;
- }</text>
- </content>
- <name>saving</name>
- <script></script>
- </card>
-
-
- card_5143.xml
- <?xml version="1.0" encoding="utf-8" ?>
- <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
- <card>
- <id>5143</id>
- <filler1>0</filler1>
- <cantDelete> <false /> </cantDelete>
- <showPict> <true /> </showPict>
- <dontSearch> <false /> </dontSearch>
- <owner>4094</owner>
- <link rel="stylesheet" type="text/css" href="stylesheet_3084.css" />
- <part>
- <id>1</id>
- <type>field</type>
- <visible> <true /> </visible>
- <dontWrap> <false /> </dontWrap>
- <dontSearch> <false /> </dontSearch>
- <sharedText> <false /> </sharedText>
- <fixedLineHeight> <false /> </fixedLineHeight>
- <autoTab> <false /> </autoTab>
- <lockText> <true /> </lockText>
- <rect>
- <left>358</left>
- <top>24</top>
- <right>476</right>
- <bottom>41</bottom>
- </rect>
- <style>opaque</style>
- <autoSelect> <false /> </autoSelect>
- <showLines> <false /> </showLines>
- <wideMargins> <false /> </wideMargins>
- <multipleLines> <false /> </multipleLines>
- <reservedFamily> 0 </reservedFamily>
- <titleWidth>0</titleWidth>
- <icon>0</icon>
- <textAlign>center</textAlign>
- <font>Chicago</font>
- <textSize>12</textSize>
- <textStyle>plain</textStyle>
- <textHeight>16</textHeight>
- <name></name>
- <script></script>
- </part>
- <content>
- <layer>card</layer>
- <id>1</id>
- <text>Document Based</text>
- </content>
- <content>
- <layer>background</layer>
- <id>5</id>
- <text>OSErr TerminalOpenDocument(
- TermHandle *terminal,
- WindowPtr window)
- {
- OSErr error;
- Handle toolName;
- short procID;
- Handle configStr;
- Rect rect;
-
- *terminal = nil;
-
- toolName = Get1Resource('STR ', kTMResourceID);
- if (nil == toolName)
- {
- error = ResError();
- if (noErr == error)
- {
- error = resNotFound;
- }
- return error;
- }
-
- configStr = Get1Resource('CSTR', kTMResourceID);
- if (nil == configStr)
- {
- error = ResError();
- if (noErr == error)
- {
- error = resNotFound;
- }
- return error;
- }
-
- MoveHHi(toolName);
- HLock(toolName);
- procID = TMGetProcID(*toolName);
- HUnlock(toolName);
- ReleaseResource(toolName);
- if (-1 == procID)
- {
- return tmGenericError;
- }
-
- rect = (*window).portRect;
- rect.right -= 15;
- rect.bottom -= 15;
-
- *terminal = TMNew(
- &rect,
- &rect,
- 0,
- procID,
- window,
- (ProcPtr) &MySendProc,
- (ProcPtr) &MyCacheProc,
- (ProcPtr) &MyBreakProc,
- (ProcPtr) &MyClickLoop,
- (ProcPtr) &MyEnvironProc,
- (long) SetCurrentA5(),
- 0
- );
- if (nil == *terminal)
- {
- error = ResError();
- if (noErr == error)
- {
- error = resNotFound;
- }
- return error;
- }
-
- MoveHHi(configStr);
- HLock(configStr);
- error = TMSetConfig(*terminal, *configStr);
- HUnlock(configStr);
- ReleaseResource(configStr);
- if (noErr != error)
- {
- TMDispose(*terminal);
- *terminal = nil;
- return error;
- }
-
- return noErr;
- }
- </text>
- </content>
- <name>Document</name>
- <script></script>
- </card>
-
-
- card_5073.xml
- <?xml version="1.0" encoding="utf-8" ?>
- <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
- <card>
- <id>5073</id>
- <filler1>0</filler1>
- <cantDelete> <false /> </cantDelete>
- <showPict> <true /> </showPict>
- <dontSearch> <false /> </dontSearch>
- <owner>4094</owner>
- <link rel="stylesheet" type="text/css" href="stylesheet_3084.css" />
- <part>
- <id>1</id>
- <type>field</type>
- <visible> <true /> </visible>
- <dontWrap> <false /> </dontWrap>
- <dontSearch> <false /> </dontSearch>
- <sharedText> <false /> </sharedText>
- <fixedLineHeight> <false /> </fixedLineHeight>
- <autoTab> <false /> </autoTab>
- <lockText> <true /> </lockText>
- <rect>
- <left>390</left>
- <top>24</top>
- <right>451</right>
- <bottom>41</bottom>
- </rect>
- <style>opaque</style>
- <autoSelect> <false /> </autoSelect>
- <showLines> <false /> </showLines>
- <wideMargins> <false /> </wideMargins>
- <multipleLines> <false /> </multipleLines>
- <reservedFamily> 0 </reservedFamily>
- <titleWidth>0</titleWidth>
- <icon>0</icon>
- <textAlign>center</textAlign>
- <font>Chicago</font>
- <textSize>12</textSize>
- <textStyle>plain</textStyle>
- <textHeight>16</textHeight>
- <name></name>
- <script></script>
- </part>
- <content>
- <layer>card</layer>
- <id>1</id>
- <text>Default</text>
- </content>
- <content>
- <layer>background</layer>
- <id>5</id>
- <text>OSErr TerminalDefault(
- TermHandle *terminal,
- WindowPtr window)
- {
- OSErr error;
- Str255 toolName;
- short procID;
- Rect rect;
-
- *terminal = nil;
-
- error = CRMGetIndToolName(
- classTM, 1, toolName);
- if (noErr != error)
- {
- return error;
- }
-
- procID = TMGetProcID(toolName);
- if (-1 == procID)
- {
- return tmGenericError;
- }
-
- rect = (*window).portRect;
- rect.right -= 15;
- rect.bottom -= 15;
-
- *terminal = TMNew(
- &rect,
- &rect,
- 0,
- procID,
- window,
- (ProcPtr) &MySendProc,
- (ProcPtr) &MyCacheProc,
- (ProcPtr) &MyBreakProc,
- (ProcPtr) &MyClickLoop,
- (ProcPtr) &MyEnvironProc,
- (long) SetCurrentA5(),
- 0
- );
- if (nil == *terminal)
- {
- error = ResError();
- if (noErr == error)
- {
- error = resNotFound;
- }
- return error;
- }
-
- return noErr;
- }
- </text>
- </content>
- <name>Default</name>
- <script></script>
- </card>
-
-
- card_4769.xml
- <?xml version="1.0" encoding="utf-8" ?>
- <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
- <card>
- <id>4769</id>
- <filler1>0</filler1>
- <cantDelete> <false /> </cantDelete>
- <showPict> <true /> </showPict>
- <dontSearch> <false /> </dontSearch>
- <owner>4094</owner>
- <link rel="stylesheet" type="text/css" href="stylesheet_3084.css" />
- <part>
- <id>1</id>
- <type>field</type>
- <visible> <true /> </visible>
- <dontWrap> <false /> </dontWrap>
- <dontSearch> <false /> </dontSearch>
- <sharedText> <false /> </sharedText>
- <fixedLineHeight> <false /> </fixedLineHeight>
- <autoTab> <false /> </autoTab>
- <lockText> <true /> </lockText>
- <rect>
- <left>378</left>
- <top>24</top>
- <right>454</right>
- <bottom>41</bottom>
- </rect>
- <style>opaque</style>
- <autoSelect> <false /> </autoSelect>
- <showLines> <false /> </showLines>
- <wideMargins> <false /> </wideMargins>
- <multipleLines> <false /> </multipleLines>
- <reservedFamily> 0 </reservedFamily>
- <titleWidth>0</titleWidth>
- <icon>0</icon>
- <textAlign>center</textAlign>
- <font>Chicago</font>
- <textSize>12</textSize>
- <textStyle>plain</textStyle>
- <textHeight>16</textHeight>
- <name></name>
- <script></script>
- </part>
- <content>
- <layer>card</layer>
- <id>1</id>
- <text>Structure</text>
- </content>
- <content>
- <layer>background</layer>
- <id>5</id>
- <text>struct TermRecord {
- short procID;
- TMFlags flags;
- TMErr errCode;
- long refCon;
- long userData;
- ProcPtr defProc;
- Ptr config;
- Ptr oldConfig;
- ProcPtr environsProc;
- long reserved1;
- long reserved2;
- Ptr tmPrivate;
- ProcPtr sendProc;
- ProcPtr breakProc;
- ProcPtr cacheProc;
- ProcPtr clikLoop;
- WindowPtr owner;
- Rect termRect;
- Rect viewRect;
- Rect visRect;
- long lastIdle;
- TMSelection selection;
- TMSelTypes selType;
- long mluField;
- };
- typedef struct TermRecord TermRecord;
- typedef TermRecord **TermHandle, *TermPtr;
-
-
- </text>
- </content>
- <name>Structure</name>
- <script></script>
- </card>
-
-
- card_4211.xml
- <?xml version="1.0" encoding="utf-8" ?>
- <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
- <card>
- <id>4211</id>
- <filler1>0</filler1>
- <cantDelete> <false /> </cantDelete>
- <showPict> <true /> </showPict>
- <dontSearch> <false /> </dontSearch>
- <owner>4094</owner>
- <link rel="stylesheet" type="text/css" href="stylesheet_3084.css" />
- <part>
- <id>6</id>
- <type>field</type>
- <visible> <false /> </visible>
- <dontWrap> <false /> </dontWrap>
- <dontSearch> <false /> </dontSearch>
- <sharedText> <false /> </sharedText>
- <fixedLineHeight> <false /> </fixedLineHeight>
- <autoTab> <false /> </autoTab>
- <lockText> <true /> </lockText>
- <rect>
- <left>130</left>
- <top>280</top>
- <right>576</right>
- <bottom>352</bottom>
- </rect>
- <style>scrolling</style>
- <autoSelect> <false /> </autoSelect>
- <showLines> <false /> </showLines>
- <wideMargins> <false /> </wideMargins>
- <multipleLines> <false /> </multipleLines>
- <reservedFamily> 0 </reservedFamily>
- <titleWidth>0</titleWidth>
- <icon>0</icon>
- <textAlign>left</textAlign>
- <font>Geneva</font>
- <textSize>9</textSize>
- <textStyle>plain</textStyle>
- <textHeight>12</textHeight>
- <name>the 411 info</name>
- <script></script>
- </part>
- <part>
- <id>7</id>
- <type>field</type>
- <visible> <true /> </visible>
- <dontWrap> <false /> </dontWrap>
- <dontSearch> <false /> </dontSearch>
- <sharedText> <false /> </sharedText>
- <fixedLineHeight> <false /> </fixedLineHeight>
- <autoTab> <false /> </autoTab>
- <lockText> <true /> </lockText>
- <rect>
- <left>357</left>
- <top>24</top>
- <right>475</right>
- <bottom>41</bottom>
- </rect>
- <style>opaque</style>
- <autoSelect> <false /> </autoSelect>
- <showLines> <false /> </showLines>
- <wideMargins> <false /> </wideMargins>
- <multipleLines> <false /> </multipleLines>
- <reservedFamily> 0 </reservedFamily>
- <titleWidth>0</titleWidth>
- <icon>0</icon>
- <textAlign>center</textAlign>
- <font>Chicago</font>
- <textSize>12</textSize>
- <textStyle>plain</textStyle>
- <textHeight>16</textHeight>
- <name></name>
- <script></script>
- </part>
- <content>
- <layer>background</layer>
- <id>5</id>
- <text>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- </text>
- </content>
- <content>
- <layer>card</layer>
- <id>7</id>
- <text>Terminal Record</text>
- </content>
- <content>
- <layer>card</layer>
- <id>6</id>
- <text><span class="style15">KY CRMGetIndToolName
- Getting the name of a tool
-
- Function CRMGetIndToolName(bundleType: OSType; index: INTEGER;
- VAR toolName: Str255): OSErr;
-
- Description: CRMGetIndToolName returns the name of a tool in toolName.
-
- The appropriate values for bundleType are as follows:
-
- CONST
- ClassCM = 'cbnd';
- ClassFT = 'fbnd';
- ClassTM = 'tbnd';
-
- index specifies which occurrence of a particular type of
- tool to return. For example, if index is 2, the
- Communications Resource Manager returns the name of the
- second tool of a particular type in toolName. If the
- Communications Resource Manager cannot find a tool that
- matches the specified parameters, an empty string is
- returned in toolName.
- •
- √¶KY Get1Resource
- Get1Resource is the same as GetResource except that it searches the current resource
- file only.
- </span><span class="style1">•
- </span><span class="style15">√¶KY TMGetProcID
- Getting current procID information
-
- Function TMGetProcID(name: Str255): INTEGER;
-
- Description: Your application should call TMGetProcID just before
- creating a new terminal record, to find out the procID
- of a tool.
-
- name specifies a terminal tool. If a terminal tool is
- available with the specified name, its procID is
- returned. If name references a nonexistent terminal
- tool, TMGetProcID returns –1.
- •
- √¶KY TMNew
- Creating a terminal record
-
- Function TMNew(termRect: Rect; viewRect: Rect; flags: TMFlags;
- procID: INTEGER; owner: WindowPtr; sendProc: ProcPtr;
- cacheProc: ProcPtr; breakProc: ProcPtr; clikLoop:
- ProcPtr; environsProc: ProcPtr; refCon: LONGINT;
- userData: LONGINT): TermHandle;
-
- Description: Once the Terminal Manager has been initialized, your
- application needs to call TMNew to create a terminal
- record to describe the terminal emulation that is to
- take place. TMNew creates a new terminal record, fills
- in the fields it can, based on the parameters that were
- passed to it, and returns a handle to the new record in
- TermHandle. TMNew automatically makes two calls to
- TMDefault (which is described later in this chapter) to
- fill in config and oldConfig. The Terminal Manager then
- loads the terminal tool’s main definition procedure,
- moves it high in the current heap, and locks it. If an
- error occurs that prevents a new terminal record from
- being created (for example, running out of memory),
- TMNew passes back NIL in TermHandle.
- Your application must set the current port to the
- terminal window before it calls TMNew.
-
- termRect is a rectangle in local coordinates that
- represents the boundaries of the terminal emulation
- region. Your application initially sets this value by
- passing it as a parameter to TMNew. viewRect is a subset
- of termRect, which the terminal tool can actually write
- into. Your application initially sets this value by
- passing it as a parameter to TMNew, but the terminal
- tool may resize it.
-
- flags is a bit field with the following masks:
-
- CONST
- tmInvisible = $00000001;
- tmSaveBeforeClear = $00000002;
- tmNoMenus = $00000004;
- tmAutoScroll = $00000008;
-
- flags represents a request from your application for a level of
- service.
- Apple Computer, Inc. has reserved the bits of flags that are not
- shown in this document. Do not use them, or your code may not
- work in the future.
- If your application sets tmInvisible, the Terminal Manager
- maintains a terminal emulation but does not display it. Your
- application can use the terminal emulation and cache regions to
- create some other presentation service instead of a terminal
- emulation.
- If your application sets tmSaveBeforeClear, the terminal tool
- attempts to cache the entire terminal emulation region in response
- to any clear-screen operation. Clear-screen operations are generated
- from either a user’s request, a clear-screen character sequence, or
- a terminal-reset character sequence.
- If your application sets tmNoMenus, the terminal tool does not
- display any custom menus.
-
- If your application sets tmAutoScroll, the terminal tool
- automatically scrolls the terminal emulation window (if necessary)
- while the user highlights a selection.
-
- procID values are dynamically assigned by the Terminal Manager to
- tools at run time. Applications should not store procID values in
- “settings” files. Instead, they should store tool names, which can
- be converted to procID values with TMGetProcID. Use the ID that
- TMGetProcID returns for procID.
-
- owner is a pointer to the window in which your application is
- displaying the terminal emulation. If tmInvisible is FALSE, owner
- should be a grafPort that the terminal tool has control over.
-
- sendProc is a pointer to a routine the terminal tool calls when it
- needs to send data on a connection. A more detailed description of
- sendProc appears later in this chapter, in the section “Routines
- That Must Be in Your Application.”
-
- cacheProc is a pointer to a routine in your application that saves
- lines that scroll off the top of the terminal emulation region. This
- routine also saves the terminal screen before a clear-screen
- operation (if TMSaveBeforeClear is set). If your application does
- not have a cacheProc, specify NIL in this field. A more detailed
- description of cacheProc appears later in this chapter in the
- section “Routines That Must Be in Your Application.”
-
- breakProc is a pointer to a routine in your application that
- performs some sort of break operation. The effect the break has
- depends upon the terminal emulation tool that your application is
- using. A more detailed description of breakProc appears later in
- this chapter in the section “Routines That Must Be in Your
- Application.”
-
- clikLoop is a pointer to a routine in your application that is
- called when the mouse button is held down. The terminal tool calls
- the click loop repeatedly when users are clicking and dragging the
- mouse. A more detailed description of clikLoop appears later in this
- chapter, in the section “Routines That Must Be in Your Application.”
- Specify NIL in this field if your application has no clikLoop
- procedure.
-
- environsProc is a pointer to a routine that the terminal tool calls
- when it requires information about the connection. See “Connection
- Manager Routines” in Chapter 3 for information about the
- CMGetConnEnvirons routine.
-
- userData and refCon are fields your application can use.
- •
- √¶KY TMSetConfig
- Setting the configuration with a string
-
- Function TMSetConfig(hTerm: TermHandle; thePtr: Ptr): INTEGER;
-
- Description: TMSetConfig passes a configuration string to the
- terminal tool.
-
- TMSetConfig passes a null-terminated, C-style string
- (see the example string later in this section) to the
- terminal tool for parsing. The string is pointed to
- by thePtr and must contain tokens that describe the
- configuration of the terminal record. The string can be
- any length.
-
- TMSetConfig ignores items it does not recognize or
- find relevant; such an occurrence causes the terminal
- tool to stop parsing the string and to return the
- character position where the error occurred. If the
- terminal tool successfully parses the string, it returns
- tmNoErr. If the terminal tool does not successfully
- parse the string, it returns one of the following values:
- a number less than –1 to indicate an OSErr, –1 to
- indicate an unknown error, or a positive number to
- indicate the character position where parsing was
- stopped.
- Individual terminal tools are responsible for the
- parsing operation.
-
- Sample: A null-terminated, C-style configuration string
-
- FontSize 9 Width 80 Cursor Underline Online True
- LocalEcho False AutoRepeat True RepeatControls False
- AutoWrap False NewLine False SmoothScroll False
- Transparent False SwapBSDelete False\0
- •
- √¶KY TMDispose
- Disposing of a terminal record
-
- Procedure TMDispose(hTerm: TermHandle);
-
- Important: Your application must call TMDispose before
- disposing of the terminal emulation window with
- DisposeWindow. Since DisposeWindow clears all controls
- in the control list, a subsequent call to TMDispose may
- cause problems.
-
- Description: TMDispose disposes of the terminal record and all
- associated data structures and controls.
- •
- √¶KY TMGetToolName
- Getting the name of a tool
-
- Procedure TMGetToolName(procID: INTEGER; VAR name: Str255);
-
- Description: TMGetToolName returns in name the name of the tool
- specified by procID.
-
- If procID references a terminal tool that does not
- exist, the Terminal Manager sets name to an empty
- string.
- •
- √¶KY TMGetConfig
- Getting the configuration string
-
- Function TMGetConfig(hTerm: TermHandle): Ptr;
-
- Description: TMGetConfig gets a configuration string from the
- terminal tool.
-
- TMGetConfig returns a null-terminated, C-style string
- from the terminal tool containing tokens that fully
- describe the configuration of the terminal record.
- For an example, see the description of the next routine.
- If an error occurs, TMGetConfig returns NIL.
- It is the responsibility of your application to
- dispose of Ptr.
- •
- √¶KY procID
- procID is the terminal tool ID. This value is dynamically assigned by
- the Terminal Manager when your application calls TMGetProcID.
- •
- √¶KY flags
- flags is a bit field with the following masks:
-
- CONST
- tmInvisible = $00000001;
- tmSaveBeforeClear = $00000002;
- tmNoMenus = $00000004;
- tmAutoScroll = $00000008;
-
- TYPE
- TMFlags : LONGINT;
-
- If your application sets tmInvisible, the Terminal
- Manager maintains a terminal emulation but does not
- display it. Your application can use the terminal
- emulation and cache region to create some other
- presentation service, instead of a terminal emulation.
- If your application sets tmSaveBeforeClear, the
- terminal tool will try to cache the entire terminal
- emulation region in response to any clear-screen
- operation. Clear-screen operations are generated from a
- user’s request, a clear-screen character sequence, or a
- terminal-reset character sequence.
- If your application sets tmNoMenus, the terminal
- tool will not put up any custom menus.
- If your application sets tmAutoScroll, the terminal
- tool will automatically scroll the terminal emulation
- window (if necessary) while the user is highlighting a
- selection.
- •
- √¶KY errCode
- The Terminal Manager does not use errCode; it is included in this
- version (version 1.0) of the terminal record for reasons of historical
- preservation. Your application must not use this field.
- •
- √¶KY refCon
- refCon is a LONGINT that your application can use.
- •
- √¶KY userData
- userData is a LONGINT that your application can use.
- •
- √¶KY defProc
- defProc is a pointer to the main code resource of the terminal tool
- that will implement the specifics of the terminal emulation. The
- terminal tool’s main code resource is of type 'tdef'.
- •
- √¶KY config
- config is a pointer to a data block that is private to the terminal
- tool.
- Your application can store the contents of config to save the state
- of a terminal in a document. The structure, size, and contents of the
- configuration record are set by the tool. Your application can determine
- the size of the configuration record by calling GetPtrSize, overwrite
- its contents using BlockMove, and validate the contents with TMValidate.
- Your application can use TMGetConfig and TMSetConfig to manipulate
- fields in this record. For details, read “Interfacing with a Scripting
- Language,” later in this chapter. Your application can save the state of
- the terminal record by saving the string TMGetConfig returns. Also, your
- application can restore the configuration of the terminal record by
- passing a saved string to TMSetConfig.
- You can find a description of config from a terminal tool perspective in
- Chapter 8.
- •
- √¶KY oldConfig
- oldConfig is a pointer to a data block that is private to the
- terminal tool and contains the most recently saved version of config.
- Your application is responsible for setting oldConfig when the user
- saves a session document.
- •
- √¶KY environsProc
- environsProc is a pointer to a routine in your application that the
- terminal tool can call to obtain a record describing the connection
- environment. A more detailed description of environsProc appears later
- in this chapter in “Routines That Must Be in Your Application.”
- •
- √¶KY reserved2
- reserved1 and reserved2 are reserved for the Terminal Manager. Your
- application must not use this field.
- •
- √¶KY reserved1
- reserved1 and reserved2 are reserved for the Terminal Manager. Your
- application must not use this field.
- •
- √¶KY tmPrivate
- tmPrivate is a pointer to a data block that is private to the
- terminal tool. Your application must not use this field.
- •
- √¶KY sendProc
- sendProc is a pointer to a routine your application calls when it
- needs to send data to another application. A more detailed description
- of sendProc appears later in this chapter in “Routines That Must Be in
- Your Application.”
- •
- √¶KY breakProc
- breakProc is a pointer to a routine in your application that performs
- a break operation. The effect the break has depends on the terminal
- emulation being used. A more detailed description of breakProc appears
- later in this chapter in “Routines That Must Be in Your Application.”
- •
- √¶KY cacheProc
- cacheProc is a pointer to a routine in your application that saves
- lines that scroll off the top of the terminal emulation region. The
- terminal tool also uses this routine to save the terminal screen before
- a clear-screen operation (if the TMSaveBeforeClear bit is set in the
- flags field of the terminal record). A more detailed description of
- cacheProc appears later in this chapter in “Routines That Must Be in
- Your Application.”
- •
- √¶KY clikLoop
- clikLoop is a pointer to a routine in your application that handles
- mouse clicks. The terminal tool calls the click loop repeatedly when the
- user is clicking or dragging an object. A more detailed description of
- this routine appears later in this chapter in “Routines That Must Be in Your Application.”
- •
- √¶KY owner
- owner is a pointer to the grafPort in which your application displays
- the terminal emulation.
- •
- √¶KY termRect
- termRect is the portRect of the current window, minus the scroll
- bars. This portRect represent the boundaries of the terminal emulation
- region. Figure 4-3 shows how termRects relates to the terminal emulation
- window.
-
- Note: Your application can display the terminal
- emulation region in an area that is smaller than
- termRect, but it must not display the combination of the
- cache region and terminal emulation region in an area
- larger than termRect.
- •
- √¶KY viewRect
- viewRect is a rectangle, measured in pixels, that represents the
- screen of an actual terminal. For some terminal types—for instance,
- Teletype or VT102™— has viewRect 24 lines and 80 columns. The dimensions
- of viewRect remain constant except when elements such as a tab ruler or
- status bar appear in the terminal emulation window, or when the size of
- the display font changes. The relationship of termRect to viewRect
- determines how much of viewRect is visible in the terminal emulation
- window.
- •
- √¶KY visRect
- visRect is a rectangle that represents the currently visible rows
- and columns in the terminal emulation region (for text terminals).
- Numbering of rows and columns begins with the number 1.
- visRect.top is the top visible line, and visRect.left is the
- leftmost visible column in the terminal emulation region. visRect.bottom
- is the bottom visible line, and visRect.right is the rightmost visible
- column in the terminal region. These values are used by the application
- to determine scroll-bar values.
- •
- √¶KY lastIdle
- lastIdle is the last time, in ticks, that the idle procedure was
- called for the specified terminal record.
- •
- √¶KY selection
- selection is a data structure that describes the extent of the
- current selection in the terminal emulation window. Since selection can
- describe either a rectangle or a region, it describes the selection in
- one of two kinds of data structures: a Rect or a RgnHandle. The format
- of the TMSelection data structure is as follows:
-
- TYPE
- TMSelection = RECORD
- CASE INTEGER OF
- 1: (
- selRect : Rect;
- );
- 2: (
- selRgnHandle : RgnHandle;
- filler : LONGINT;
- );
- END;
-
- selRect is of type Rect and describes the rectangle that has been
- selected. On a text terminal, it contains the row/column pairs, with
- counting beginning at 1. On a graphics terminal, it contains pixel
- coordinates, with (1,1) being the topLeft corner of the terminal region.
- On a graphics terminal, if the selection is a MacPaint-style lasso,
- selection is a selRgnHandle that represents the selection region.
- •
- √¶KY selType
- selType is a field that further describes a selection; it indicates
- the highlighting mode that is used to show the selection. Valid values
- are as follows:
-
- CONST
- selTextNormal = $0001;
- selTextBoxed = $0002;
- selGraphicsMarquee = $0004;
- selGraphicsLasso = $0008;
-
- TYPE
-
-
- TMSelTypes = INTEGER;
-
- selGraphicsMarquee is a standard rectangular MacPaint-style marquee.
- selGraphicsLasso is a standard MacPaint-style lasso. Your application
- uses these types of highlighting with graphics terminals.
- •
- √¶KY mluField
- mluField is a LONGINT that terminal tools use. Your application does
- not need to be concerned with this field.
- •
- </span></text>
- </content>
- <name>terminal</name>
- <script></script>
- </card>
-
-
- card_14809.xml
- <?xml version="1.0" encoding="utf-8" ?>
- <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
- <card>
- <id>14809</id>
- <filler1>0</filler1>
- <cantDelete> <false /> </cantDelete>
- <showPict> <true /> </showPict>
- <dontSearch> <false /> </dontSearch>
- <owner>2117</owner>
- <link rel="stylesheet" type="text/css" href="stylesheet_3084.css" />
- <part>
- <id>1</id>
- <type>field</type>
- <visible> <true /> </visible>
- <dontWrap> <false /> </dontWrap>
- <dontSearch> <false /> </dontSearch>
- <sharedText> <false /> </sharedText>
- <fixedLineHeight> <false /> </fixedLineHeight>
- <autoTab> <false /> </autoTab>
- <lockText> <true /> </lockText>
- <rect>
- <left>387</left>
- <top>24</top>
- <right>452</right>
- <bottom>41</bottom>
- </rect>
- <style>opaque</style>
- <autoSelect> <false /> </autoSelect>
- <showLines> <false /> </showLines>
- <wideMargins> <false /> </wideMargins>
- <multipleLines> <false /> </multipleLines>
- <reservedFamily> 0 </reservedFamily>
- <titleWidth>0</titleWidth>
- <icon>0</icon>
- <textAlign>center</textAlign>
- <font>Chicago</font>
- <textSize>12</textSize>
- <textStyle>plain</textStyle>
- <textHeight>16</textHeight>
- <name></name>
- <script></script>
- </part>
- <content>
- <layer>card</layer>
- <id>1</id>
- <text>Init Mgr</text>
- </content>
- <content>
- <layer>background</layer>
- <id>7</id>
- <text>
- OSErr error;
-
- error = InitTM();
-
- </text>
- </content>
- <name>Init Mgr</name>
- <script></script>
- </card>
-
-
- card_14493.xml
- <?xml version="1.0" encoding="utf-8" ?>
- <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
- <card>
- <id>14493</id>
- <filler1>0</filler1>
- <cantDelete> <false /> </cantDelete>
- <showPict> <true /> </showPict>
- <dontSearch> <false /> </dontSearch>
- <owner>2117</owner>
- <link rel="stylesheet" type="text/css" href="stylesheet_3084.css" />
- <part>
- <id>1</id>
- <type>field</type>
- <visible> <true /> </visible>
- <dontWrap> <false /> </dontWrap>
- <dontSearch> <false /> </dontSearch>
- <sharedText> <false /> </sharedText>
- <fixedLineHeight> <false /> </fixedLineHeight>
- <autoTab> <false /> </autoTab>
- <lockText> <true /> </lockText>
- <rect>
- <left>387</left>
- <top>24</top>
- <right>450</right>
- <bottom>41</bottom>
- </rect>
- <style>opaque</style>
- <autoSelect> <false /> </autoSelect>
- <showLines> <false /> </showLines>
- <wideMargins> <false /> </wideMargins>
- <multipleLines> <false /> </multipleLines>
- <reservedFamily> 0 </reservedFamily>
- <titleWidth>0</titleWidth>
- <icon>0</icon>
- <textAlign>center</textAlign>
- <font>Chicago</font>
- <textSize>12</textSize>
- <textStyle>plain</textStyle>
- <textHeight>16</textHeight>
- <name></name>
- <script></script>
- </part>
- <content>
- <layer>card</layer>
- <id>1</id>
- <text>Gestalt</text>
- </content>
- <content>
- <layer>background</layer>
- <id>7</id>
- <text>OSErr TMGestalt()
- {
- OSErr error;
- long CTBVersion;
- long TMAttr;
-
- error = Gestalt(gestaltCTBVersion,
- &CTBVersion);
- if (noErr == error)
- {
- if (0x101 > CTBVersion)
- {
- error = noErr;
- }
- else
- {
- error = Gestalt(gestaltTermMgrAttr,
- &TMAttr);
- if (noErr == error)
- {
- if ((TMAttr &
- (1 << gestaltTermMgrPresent)))
- {
- error = noErr;
- }
- else
- {
- error = cmGenericError;
- }
- }
- }
- return error;
- }
- </text>
- </content>
- <name>Gestalt</name>
- <script></script>
- </card>
-
-
- card_2504.xml
- <?xml version="1.0" encoding="utf-8" ?>
- <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
- <card>
- <id>2504</id>
- <filler1>0</filler1>
- <cantDelete> <false /> </cantDelete>
- <showPict> <true /> </showPict>
- <dontSearch> <false /> </dontSearch>
- <owner>2117</owner>
- <link rel="stylesheet" type="text/css" href="stylesheet_3084.css" />
- <part>
- <id>1</id>
- <type>field</type>
- <visible> <false /> </visible>
- <dontWrap> <false /> </dontWrap>
- <dontSearch> <false /> </dontSearch>
- <sharedText> <false /> </sharedText>
- <fixedLineHeight> <false /> </fixedLineHeight>
- <autoTab> <false /> </autoTab>
- <lockText> <true /> </lockText>
- <rect>
- <left>130</left>
- <top>280</top>
- <right>576</right>
- <bottom>352</bottom>
- </rect>
- <style>scrolling</style>
- <autoSelect> <false /> </autoSelect>
- <showLines> <false /> </showLines>
- <wideMargins> <false /> </wideMargins>
- <multipleLines> <false /> </multipleLines>
- <reservedFamily> 0 </reservedFamily>
- <titleWidth>0</titleWidth>
- <icon>0</icon>
- <textAlign>left</textAlign>
- <font>Geneva</font>
- <textSize>9</textSize>
- <textStyle>plain</textStyle>
- <textHeight>12</textHeight>
- <name>the 411 info</name>
- <script></script>
- </part>
- <part>
- <id>2</id>
- <type>field</type>
- <visible> <true /> </visible>
- <dontWrap> <false /> </dontWrap>
- <dontSearch> <false /> </dontSearch>
- <sharedText> <false /> </sharedText>
- <fixedLineHeight> <false /> </fixedLineHeight>
- <autoTab> <false /> </autoTab>
- <lockText> <true /> </lockText>
- <rect>
- <left>366</left>
- <top>24</top>
- <right>463</right>
- <bottom>41</bottom>
- </rect>
- <style>opaque</style>
- <autoSelect> <false /> </autoSelect>
- <showLines> <false /> </showLines>
- <wideMargins> <false /> </wideMargins>
- <multipleLines> <false /> </multipleLines>
- <reservedFamily> 0 </reservedFamily>
- <titleWidth>0</titleWidth>
- <icon>0</icon>
- <textAlign>center</textAlign>
- <font>Chicago</font>
- <textSize>12</textSize>
- <textStyle>plain</textStyle>
- <textHeight>16</textHeight>
- <name></name>
- <script></script>
- </part>
- <content>
- <layer>card</layer>
- <id>2</id>
- <text>Initialization</text>
- </content>
- <content>
- <layer>card</layer>
- <id>1</id>
- <text>√¶KY Gestalt
- #if SystemSevenOrLater
- #pragma parameter __D0 Gestalt(__D0,__A1)
- pascal OSErr Gestalt(OSType selector,long *response)
- = {0xA1AD,0x2288};
- #else
- pascal OSErr Gestalt(OSType selector,long *response);
- #endif
- File {CIncludes}GestaltEqu.h
- Trap number: A1AD,2288
- •
- √¶KY InitTM
- Initializing the Terminal Manager
-
- Function InitTM: TMErr;
-
- Description: InitTM initializes the Terminal Manager. Your
- application should call this routine after it calls the
- standard Macintosh Toolbox initialization routines.
-
- Warning Your application must initialize the
- Communications Resource Manager (by calling InitCRM)
- and then the Communications Toolbox Utilities
- (by calling InitCTBUtilities), whether or not it uses
- any of their calls, before it initializes the Terminal
- Manager.
-
- InitTM returns an operating system error code if
- appropriate. Your application must check for the
- presence of the Communications Toolbox before calling
- this function. Sample code under “Determining Whether
- the Managers are Installed” in Appendix C shows you how
- your application can make this check.
-
- Result Codes tmGenericError, tmNoErr, tmNoTools
- •</text>
- </content>
- <name>Initialization</name>
- <script></script>
- </card>
-
-
- card_3013.xml
- <?xml version="1.0" encoding="utf-8" ?>
- <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
- <card>
- <id>3013</id>
- <filler1>0</filler1>
- <cantDelete> <false /> </cantDelete>
- <showPict> <true /> </showPict>
- <dontSearch> <false /> </dontSearch>
- <owner>2609</owner>
- <link rel="stylesheet" type="text/css" href="stylesheet_3084.css" />
- <name>Start</name>
- <script></script>
- </card>
-
-
-